<%@page import="Entity.Account"%>
<%
            if ((session.getAttribute("Admin_Session") == null)||(session.getAttribute("User_Session") != null))
            {
                response.sendRedirect(request.getContextPath() + "/index.jsp");
            } else {
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>National Level Paper Presentation</title>
<link href="style.css" rel="stylesheet" type="text/css" />
<link href="css/white/style.css" media="screen" title="shadow" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/piroBox.1_2.js"></script>
<script type="text/javascript" src="js/jquery.validate.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
	$().piroBox({
			my_speed: 600, //animation speed
			bg_alpha: 0.5, //background opacity
			radius: 4, //caption rounded corner
			scrollImage : false, // true == image follows the page, false == image remains in the same open position
			pirobox_next : 'piro_next', // Nav buttons -> piro_next == inside piroBox , piro_next_out == outside piroBox
			pirobox_prev : 'piro_prev',// Nav buttons -> piro_prev == inside piroBox , piro_prev_out == outside piroBox
			close_all : '.piro_close',// add class .piro_overlay(with comma)if you want overlay click close piroBox
			slideShow : 'slideshow', // just delete slideshow between '' if you don't want it.
			slideSpeed : 4 //slideshow duration in seconds(3 to 6 Recommended)
	});
});
</script>
<!--////// END  \\\\\\\-->
</head>
<body>

<div id="templatemo_body_wrapper">
<div id="templatemo_wrapper">

	<div id="tempaltemo_header">
    	<div id="header_content">
		</div>
    </div> <!-- end of header -->

    <div id="templatemo_main_top"></div>
    <div id="templatemo_main">

        <div id="templatemo_sidebar">

        	<div id="templatemo_menu">
<%
        if(session.getAttribute("Admin_Session")!=null)
            {

            Account ac = (Account)session.getAttribute("Admin_Session");

%>
<table>
    <tr>
            <%
                   if(ac.getAvatar()!=null)
                       {
            %>
                  <td><img class="avatarAdmin" src="images/avatar/<%= ac.getAvatar() %>"/></td>
            <%
                        }else{
            %>
                  <td><img class="avatarAdmin" src="images/avatar/avatar.jpg"/></td>
            <%
                        }
             %>
    </tr>
    <tr>
        <td align="center"><strong>Information</strong></td>

    </tr>
    <tr>
<%
        if(ac.getGender().equals("Male"))
            {
%>
    <td>Mr:</td>
<%
       }else
        {
%>
    <td>Ms:</td>
<%
        }
%>
<td><%= ac.getFullname() %></td>
    </tr>
    <tr>
        <td>Address: </td>
	<td><%= ac.getAddress() %></td>
    </tr>
    <tr>
        <td><a href="ADUpdateProfile.jsp">More Profile</a></td>
	<form action="LoginServlet" method="post">
            <td><input type="submit" name="action" value="Sign Out" class="Button"/> </td>
        </form>
    </tr>
</table>
<%}%>
<br/>
<br/>
                    <ul>
                    <li><a href="AdminHome.jsp" target="_parent">Home</a></li>
                    <li><a href="MinhNHServlet?action=AdviewAccount" target="_parent">Manage Account</a></li>
                    <li><a href="VietDQServlet?action=GetAllEvents" target="_parent">Manage Events</a></li>
                    <li><a href="PhuocPHServlet?action=GetListCate" target="_parent">Manage Category</a></li>
                    <li><a href="VietDQServlet?action=AdviewFAQ" target="_parent">Manage FAQ</a></li>
                    <li><a href="PhuocPHServlet?action=ManageFB" target="_parent">Manage FeedBack</a></li>
                    <li><a href="PhuocPHServlet?action=manageComment" target="_parent">Manage Comment</a></li>
              </ul>
            </div> <!-- end of templatemo_menu -->
            <div class="cleaner"></div>
        </div> <!-- end of sidebar -->

        <div id="templatemo_content">

            <div class="content_box">
                <h2>PROFILE</h2>
                <form name="f5" action="ADUpdateProfileServlet" method="post" enctype="multipart/form-data" id="ADUpdateProfile">
<%
    Account acc = (Account)session.getAttribute("Admin_Session");
%>
<table class="table2" border="0">
                    <tr>
                        <td align="right"><span>Username : </span></td>
                        <td align="left"><span class="style1"><%= acc.getUsername() %></span>
                            <input type="hidden" name="txtUser2" value="<%= acc.getUsername() %>"/>
                        </td>
                    </tr>
                    <tr>
                        <td align="right"><span>Password : </span></td>
                        <td align="left"><input type="password" name="txtPass2" value="<%= acc.getPassword() %>" class="inputt" id="txtPass"/>(<span class="style1">*</span>)<br/>
                        <label for="txtPass2" generated="true" class="error"></label></td>
                    </tr>
                    <tr>
                        <td align="right"><span>Confirm Password : </span></td>
                        <td align="left"><input type="password" name="txtCfPass2" value="<%= acc.getPassword() %>" class="inputt" id="txtCfPass"/>(<span class="style1">*</span>)<br/>
                        <label for="txtCfPass2" generated="true" class="error"></label></td>
                    </tr>
                    <tr>
                        <td align="right"><span>Fullname : </span></td>
                        <td align="left"><input type="text" name="txtFull2" value="<%= acc.getFullname() %>" class="inputt"/>(<span class="style1">*</span>)<br/>
                        <label for="txtFull2" generated="true" class="error"></label></td>
                    </tr>
                    <tr>
                        <td align="right"><span>Email : </span></td>
                        <td align="left"><%= acc.getEmail() %></td>
                    </tr>
                    <tr>
                        <td align="right"><span>Gender : </span></td>
                        <td align="left"><%= acc.getGender() %></td>
                    </tr>
                    <tr>
                        <td align="right" valign="top"><span>Address : </span></td>
                        <td align="left"><textarea name="txtAdd2"><%= acc.getAddress() %></textarea>(<span class="style1">*</span>)<br/>
                        <label for="txtAdd2" generated="true" class="error"></label></td>
                    </tr>
                    <tr>
                        <td align="right"><span>Phone : </span></td>
                        <td align="left"><input type="text" name="txtPhone2" value="<%= acc.getPhone() %>" class="inputt"/>(<span class="style1">*</span>)<br/>
                        <label for="txtPhone2" generated="true" class="error"></label></td>
                    </tr>
                    <tr>
                        <td align="right"><span>School : </span></td>
                        <td align="left"><input type="text" name="txtSchool2" value="<%= acc.getSchool() %>" class="inputt"/>(<span class="style1">*</span>)<br/>
                        <label for="txtSchool2" generated="true" class="error"></label></td>
                    </tr>
                    <tr>
                        <td align="right"><span>Birthday : </span></td>
                        <td align="left"><%= acc.getBirthday() %></td>
                    </tr>
                    <tr>
                        <td align="right" valign="top"><span>Avatar : </span></td>
                        <td align="left">
<%
        if(acc.getAvatar()==null)
            {
%>
                            <img class="avatar" src="images/avatar/avatar.jpg" width="100" height="100"/><br/>
<%
        }else{

%>
                            <img class="avatar" src="images/avatar/<%= acc.getAvatar() %>" width="100" height="100"/><br/>
<%
               }
%>
                            <input type="file" name="fileAvatar2" accept="fileupload/*" size="25"/>(<span class="style1">*</span>)<br/>
                        <label for="fileAvatar2" generated="true" class="error"></label></td>
                    </tr>
                    <tr>
                        <td></td>
                        <td align="left">
                            <input type="submit" name="action" value="Save" class="Button"/>
                            <input type="reset" name="action" value="Reset" class="Button"/>
                        </td>
                    </tr>
                </table>
            </form>
<script type="text/javascript">
    jQuery(document).ready(function($) {
           $("#ADUpdateProfile").validate({
             messages: {
                 txtPass2: {
                     required: "Password is required",
                     rangelength: "Password must be 6 to 20 characters"
                 },
                 txtCfPass2: {
                     required: "Password Confirm is required",
                     equalTo: "Please enter the same value with Password",
                     rangelength: "Password Confirm must be 6 to 20 characters"
                 },
                 txtFull2: {
                     required: "Full Name is required",
                     rangelength: "Full Name must be from 5 to 30 characters"
                 },
                  txtPhone2: {
                     required: "Phone is required",
                     digits:"Please enter only Number" ,
                     rangelength: "Phone must be from 9 to 11 characters"
                 },
                 txtAdd2:{
                     required: "Address is required",
                     rangelength: "Address must be from 5 to 50 characters"
                 },
                 txtSchool2:{
                     required: "School is required",
                     rangelength: "School must be from 5 to 50 characters"
                 },
                 fileAvatar2: {
                     accept:"Avatar only accept file jpg,png,gif"
                 }
            },
            rules: {
                txtPass2: {
                    required: true,
                    rangelength: [6, 20]
                },
                txtCfPass2: {
                    required: true,
                    equalTo: "#txtPass",
                    rangelength: [6, 20]
                },
                txtFull2: {
                    required: true,
                    rangelength: [5, 30]
                },
                 txtPhone2: {
                    required: true,
                    digits: true,
                    rangelength: [9, 11]
                },
                txtAdd2:{
                    required: true,
                    rangelength: [5, 50]
                },
                txtSchool2:{
                    required: true,
                    rangelength: [5, 50]
                },
                fileAvatar2: {
                    accept:'jpg|gif|png'
                }
            }
        });
    });
         $(".cancel").click(function() {
		validator.resetForm();
	});

 </script>
              <div class="cleaner h30"></div>

          </div>

        </div>

        <div class="cleaner"></div>
    </div>

    <div id="templatemo_main_bottom">
    </div>

</div> <!-- end of wrapper -->
</div>

<div id="templatemo_footer_wrapper">
	<div id="templatemo_footer">
        Copyright © 2012 <a href="#">KSC Technology and Sciences</a> |
                Designed by <a href="#">Group_05_F2-1104-T1_FAT2_FPT-Aptech</a>

    </div>
</div>

</body>
</html>
<%
    }
%>